package sample;

import java.awt.Color;
import robocode.HitRobotEvent;
import robocode.HitWallEvent;
import robocode.Robot;

/**
 * Robo Faz Nada<br />
 * sera controlado via Jason 
 * @author Emerson Shigueo Sugimoto
 * @author Lucas Del Castanhel
 * */
public class RoboInimigo extends Robot {
	public RoboInimigo() { }

	public void run(){
		setBodyColor(Color.RED);
		setGunColor(Color.YELLOW);
		setRadarColor(Color.BLUE);
		setBulletColor(Color.green);
		setScanColor(Color.RED);
		
		while(true){
			turnLeft(getHeading() % 90);
			turnGunRight(90);

			while(true){
				turnRadarRight(360);
				turnRadarLeft(360);
				ahead(1000);
				turnRight(90);
			}
		}
		
//		while(true){
//			if (_listaAcoes != null && _listaAcoes.size() >= 2) {
//				executar(); 
//			} else {
//				// Sets the robot to move forward, backward or stop moving depending
//				// on the move direction and amount of pixels to move
//				setAhead(moveAmount * moveDirection);
//
//				// Decrement the amount of pixels to move until we reach 0 pixels
//				// This way the robot will automatically stop if the mouse wheel
//				// has stopped it's rotation
//				moveAmount = Math.max(0, moveAmount - 1);
//
//				// Sets the robot to turn right or turn left (at maximum speed) or
//				// stop turning depending on the turn direction
//				setTurnRight(45 * turnDirection); // degrees
//
//				// Turns the gun toward the current aim coordinate (x,y) controlled by
//				// the current mouse coordinate
//				double angle = normalAbsoluteAngle(Math.atan2(aimX - getX(), aimY - getY()));
//
//				setTurnGunRightRadians(normalRelativeAngle(angle - getGunHeadingRadians()));
//
//				// Fire the gun with the specified fire power, unless the fire power = 0
//				if (firePower > 0) {
//					setFire(firePower);
//				}
//
//				// Execute all pending set-statements
//				execute();
//
//				// Next turn is processed in this loop..
//			}
//		}
	}
	
	@Override
	public void onHitRobot(HitRobotEvent e) {
		ahead(-10); //super.onHitRobot(e);
		turnLeft(20);
	}
	
	@Override
	public void onHitWall(HitWallEvent e) {
		//super.onHitWall(e);
		ahead(-10);
		turnLeft(20);
	}	
}